﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Weiz.TaskManager.DAL;
using Weiz.TaskManager.Models;

namespace Weiz.TaskManager.BLL
{
    public class ResourcesBLL
    {
        private readonly ResourcesDAL dal = new ResourcesDAL();
        public bool Add(ResourcesModel model)
        {
            return dal.Add(model);
        }
        public string GetFileNameCode(string productId)
        {
            int num = 1;
            var result = dal.GetFileNameCode(productId);
            if (result != 0)
                num += result;

            return string.Format("{0:d4}", num);
        }
        public bool isExitsResources(string fileName,string id)
        {
            return dal.isExitsResources(fileName,id) > 0;
        }
    }
}
